<template>
	<view>

		<u-popup :show="show" @close="close"  mode="center" bgColor="transparent">
			<view class="popup-box">
				<view style="width: 600rpx;height: auto;">
					<view class="popup-top">
						<view class="popup-title">确认购买</view>
						<view class="close-btn" @click="close()">
							<image src="/static/icon-images/close.png" mode="widthFix"></image>
						</view>
					</view>


					<!-- 内容区 -->
					<view class="input-field pic-box">
						<!-- <image :src="itemNumber.imgUrl+itemNumber.detailUrl" class="product-pic"></image> -->
						<view class="right">
							<view class="name">靓号:{{itemNumber.number || 0}}</view>
							<view style="display: flex;align-items: center;gap: 20rpx;">
							</view>
							<view class="sum">单价：{{itemNumber.price || 0}}能量</view>
						</view>
					</view>

					<view class="warn-box">
						<u-icon name="warning-fill" color="#f87171" size="20"></u-icon>
						<view class="warn-text">购买后无法退款，请确认交易信息</view>
					</view>

					<view class="btn-group">
						<view class="false-btn" @click="close()">取消</view>
						<view class="true-btn" @click="submit">确认购买</view>
					</view>

				</view>
			</view>
		</u-popup>

	</view>
</template>

<script>
	export default {
		props: {
			show: {
				type: Boolean,
				default: false
			},
			itemNumber:{
				type: Object,
				default: {}
			}
		},
		data() {
			return {
				
			};
		},
		methods: {
			// 确认购买
			submit(){
				this.$emit('success')
			},
			close() {
				this.$emit('close')
			}
		}
	}
</script>

<style lang="scss">
	.popup-box {
		background: linear-gradient(135deg, #0a1a3a 0%, #050a1a 100%);
		border: 1rpx solid rgba(255, 255, 255, 0.15);
		border-radius: 20rpx;
		overflow-y: auto;
		padding: 30rpx;
	}

	.popup-top {
		display: flex;
		align-items: center;
		justify-content: space-between;
	}

	.popup-title {
		font-weight: 700;
		font-size: 38rpx;
		color: #e2e8f0;
	}

	.close-btn {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 60rpx;
		height: 60rpx;
		border-radius: 50%;
		background: rgba(255, 255, 255, 0.15);

		image {
			display: block;
			width: 28rpx;
			height: 28rpx;
		}
	}

	.product-pic {
		display: block;
		width: 150rpx;
		height: 150rpx;
		border-radius: 10rpx;
	}

	.pic-box {
		margin-top: 30rpx;
		padding: 30rpx;
		display: flex;
		align-items: center;
	}

	.name {
		line-height: 1;
		font-size: 36rpx;
		color: #fff;
		font-weight: 700;
	}

	.text {
		line-height: 1;
		font-size: 28rpx;
		font-weight: 400;
		color: #9ca3af;
	}

	.sum {
		line-height: 1;
		font-size: 30rpx;
		font-weight: 500;
		color: #ff9800;
		// text-shadow: 0 0 5rpx rgba(255, 152, 0, 0.8), 0 0 10rpx rgba(255, 152, 0, 0.6);
	}

	.right {
		display: flex;
		flex-direction: column;
		gap: 20rpx;
		margin-left: 30rpx;
	}

	.warn-box {
		margin-top: 20rpx;
		display: flex;
		align-items: center;
	}

	.warn-text {
		line-height: 1;
		font-size: 28rpx;
		font-weight: 500;
		color: #f87171;
		margin-left: 10rpx;
	}

	.btn-group {
		margin-bottom: 20rpx;
		margin-top: 30rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;
	}

	.false-btn {
		display: flex;
		align-items: center;
		justify-content: center;
		font-size: 36rpx;
		color: #e2e8f0;
		background-color: #374151;
		border-radius: 10rpx;
		padding: 20rpx 94rpx;
	}

	.true-btn {
		padding: 20rpx 94rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		font-size: 36rpx;
		color: #fff;
		background-color: #4caf50;
		border-radius: 10rpx;
	}
</style>